/**
 * This is the height to string converter.
 * 
 * @author joshua
 * @version 1.0
 */
public class HeightMessageEditor {

	/**
	 * This creates a Height from a string.
	 * 
	 * @param message
	 *            the string of height.
	 * @return the Height.
	 */
	public static Height getHeight(String message) {
		int i = 0;
		while (message.charAt(i) != '-'){
			i++;
		}
		try {
			final int feet = Integer.parseInt(message.substring(0, i));
			final int inches = Integer.parseInt(message.substring(i + 1,
					message.length()));
			return new Height(feet, inches);
		} catch (Exception e) { // $codepro.audit.disable logExceptions
			return null;
		}
	}

	/**
	 * This takes a height and makes it into a String
	 * 
	 * @param height
	 *            the Height
	 * @return the message string.
	 */
	public static String getMessage(Height height) {
		return "" + height.getFeet() + "-" + height.getInches();
	}

	/**
	 * Returns null.
	 * 
	 * @return null
	 */
	public String toString() {
		return null;
	}
}
